package edu.suse.controller;

import edu.suse.common.base.RespResult;
import edu.suse.entity.SysUser;
import edu.suse.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys_user")
public class SysUserController {

   @Autowired
   private SysUserService sysUserService;

   // 查询所有用户信息
   @GetMapping("/findSysUserAll")
   public RespResult findSysUserAll(){
      return sysUserService.findSysUserAll();
   }
//   增加用户信息
   @GetMapping("/addSysUser")
   public RespResult addSysUser(SysUser su){
      return sysUserService.addSysUser(su);
   }
   @GetMapping("/editSysUser")
   public RespResult editSysUser(SysUser es){
      return sysUserService.editSysUser(es);
   }
   @GetMapping("/findSysUserById")
   public RespResult findSysUserById(int id){
      return sysUserService.findSysUserById(id);
   }
   @GetMapping("/deleteSysUserById")
   public RespResult deleteSysUserById(int id){
      return sysUserService.deleteSysUserById(id);
   }

}
